package com.yyaccp.appinfo.controller;

import com.yyaccp.appinfo.domain.AppInfo;
import com.yyaccp.appinfo.service.AppInfoService;
import com.yyaccp.appinfo.utils.AjaxResult;
import com.yyaccp.appinfo.utils.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 天天向上 （john.yi@qq.com）
 * @date 2020/11/23.
 */
@RestController
@RequestMapping("/api/appInfos")
public class AppInfoController {
    @Autowired
    private AppInfoService appInfoService;

    @RequestMapping("/search")
    public AjaxResult search(AppInfo appInfo,
                             @RequestParam(value = "page") Integer pageNo,
                             @RequestParam(value = "limit") Integer pageSize) {
        PageBean pageBean = new PageBean();
        pageBean.setPageNo(pageNo);
        pageBean.setPageSize(pageSize);
        appInfoService.search(appInfo, pageBean);
        return AjaxResult.success(pageBean);
    }
}
